<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>03_promise的链式调用</title>
</head>
<body>
    
</body>
<!-- 
    需求: 发出两次网络请求,根据返回的姓氏和名字组成一个完整的名字
-->
<script>
    new Promise((resolve,reject) => {
        setTimeout(()=>{
            //业务逻辑代码... 
           
            resolve("阿伦")    
        },1000)
    }).then( res => {
        console.log(res)

        // return new Promise((resolve,reject) => {
        //     setTimeout(()=>{
        //         resolve(res + '艾弗森')
        //     },1000)
        // })

        return Promise.resolve(res + '艾弗森')

    }).then( res => {
        console.log(res);
    })
</script>
</html>